package com.teemor.blog.rpc;


import com.teemor.blog.rpc.fallback.ArticleSearchFallbackFactory;
import com.teemor.common.bean.datasource.input.QryArticlesIPo;
import com.teemor.common.bean.datasource.output.QryArticlesOPo;
import com.teemor.common.bean.model.EsOutputModel;
import com.teemor.common.bean.model.EsQueryModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

/**
 * @Description:
 * @author zhoulk
 * @date: 2019/12/14
 */
@FeignClient(value = "datasource", path = "/es/article", fallbackFactory = ArticleSearchFallbackFactory.class)
public interface IArticleSearchRpc {

    @RequestMapping(value = "/articles", method = RequestMethod.GET, consumes = MediaType.APPLICATION_JSON_VALUE)
    EsOutputModel<QryArticlesOPo> searchArticles(@RequestBody EsQueryModel<QryArticlesIPo> inParam);

    @RequestMapping(value = "/test", method = RequestMethod.GET)
    Map test();
}
